package com.yixun.qfbao.hander;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import com.yixun.qfbao.api.service.PremisesApiService;
import com.yixun.qfbao.apidto.GetPremisesPhotoResDto;
import com.yixun.qfbao.constants.OpenApiConstant;
import com.yixun.qfbao.vo.GetPremisesPhotoReqVo;
import com.yixun.qfbao.xf.model.enums.ResultEnum;

/**
 * 
 * 〈一句话功能简述〉<br>
 * 获取楼盘相册
 * 
 * @author liushihao
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
@Service("getPremisesPhotoHander")
public class GetPremisesPhotoHander {
	private static final Logger logger = LoggerFactory.getLogger(GetPremisesPhotoHander.class);
	@Autowired
	private PremisesApiService premisesService;

	public GetPremisesPhotoResDto hander(GetPremisesPhotoReqVo reqVo) {
		GetPremisesPhotoResDto resDto = new GetPremisesPhotoResDto();
		try {
			Assert.notNull(reqVo.getParams().getPremisesId(), "楼盘ID为空");
			resDto = premisesService.getPremisesPhotoList(reqVo.getParams().getPremisesId());
			resDto.setResponseCode(ResultEnum.SUCCESS.getNo());
		} catch (Exception e) {
			resDto.setResponseCode(OpenApiConstant.RC_EXCEPTION_ERROR.getResponseCode());
			resDto.setResponseMessage(e.getMessage());
			logger.error("get premises photo hander error: {}", e);
		}
		return resDto;

	}

}
